#include #include ; //define structure struct item { short code; short onHand; }; const arraySize = 10; item items[arraySize]; //function prototype void getData(item []); void recordPurchase(); void recordSales(); void updateFile(); void record(short, short); void main() { short choice; getData(items); //display menu do { cout << "Make a choice "<> choice; switch (choice) { case 1:recordPurchase(); break; case 2:recordSales(); break; case 3:updateFile(); break; case 4:cout<< "Thanks and bye\n"; break; default:cout << "Enter a number from 1 to 4 inclusive\n"; } } while (choice !=4); } void getData(item items[]) { short i = 0; ifstream infile; infile.open("invent.txt", ios::in|ios::nocreate); if (!infile.fail()) { infile>>items[i].code>>items[i].onHand; while (!infile.eof()) { i++; infile>>items[i].code>>items[i].onHand; } infile.close(); } else cout << "\nError in opening file\n"; for (i = 0; i<10;i++) cout << items[i].code <<" " <> ic >> purch; record(ic, purch); for (short i = 0; i<10;i++) cout << items[i].code <<" " <> ic >> sales; record(ic, -sales); for (short i = 0; i<10;i++) cout << items[i].code <<" " <